<script setup>
    import { useRouter } from 'vue-router';

    /**
     * 想要路径传递参数! 对应的组件的路径应该是动态的!
     *    1. 路径地址设置为动态 :key/:key
     *    2. 路由规则需要添加一个name 
     *    3. 传递参数
     *        标签传递
     *        编程传递
     * 
     */

    let router = useRouter();
    let sendPathData = ()=>{
       //router.push("/path/to/88/ergouzi");
       router.push({name:'pathTo',params:{id:66,name:'hehe'}});
    }
</script>

<template>
  <div>
     path方案发起者!! 
     <br>
     标签路由参数: <br> 
     <router-link to="/path/to/5/ergouzi" >路由参数1</router-link>  <br>
     <!-- name 动态路由 || path  固定路由 互斥!!  -->
     <router-link :to="{name:'pathTo',params:{id:6,name:'hehe'}}" >路由参数1</router-link>  <br>

     编程路由参数: <br> 
     <button @click="sendPathData()">编程path参数</button>

  </div>
</template>

<style scoped>

</style>